import {
  ADDCOUNT,
  ADDITEM,
  UPDATE_USER
} from './mutation-type.js'
export default {
  [ADDCOUNT](state, playload) {
    playload.count++;
  },
  [ADDITEM](state, playload) {
    // 给对象加两个个新的属性值
    // checked属性方便给购物车使用
    playload.checked = true
    playload.count = 1
    state.cartList.push(playload)
  },
  // 注册用户
  [UPDATE_USER](state,playload) {
    console.log('mutation拿到的playload',playload);
    state.username =  playload
  }
}
